package bairui.international.console.web.controller.advance.property.item;

/**
 * @see bairui.international.console.web.controller.advance.property.ItemPage_BaseFilter
 *
 */
class ItemPage_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_ProductPropertyItem QRoot,
		javax.servlet.http.HttpServletRequest request
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("name"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("comment"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("state"), 
						com.lianjing.sh.model.uml.model.status.State_UpDown.class, 
						"yyyy-MM-dd"
					)
			);
			/* comment 附加过滤属性 */
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_ProductPropertyItem QRoot
	,	String name
	,	String comment
	,	com.lianjing.sh.model.uml.model.status.State_UpDown state
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		if(null != name){
			builder.and(QRoot.name.like("%"+name+"%"));
		}
		if(null != comment){
			builder.and(QRoot.comment.like("%"+comment+"%"));
		}
		if(null != state){
			builder.and(QRoot.state.eq(state));
		}
		return builder;
	}
	
}
